<!-- 组件说明 -->
<template>
  <div class=''>
    <nav-bar>
      <div slot="left" @click="backClick" class="back">
        <img src="~assets/img/common/back.svg" alt="" />
      </div>
      <div slot="center" class="title">
        <div v-for="(item,index) in titles" :key="index" class="f-1" :class="{active: index === currentIndex}" @click="titleClick(index)">{{item}}</div>
      </div>
      
    </nav-bar>
  </div>
</template>

<script>
  import NavBar from 'components/common/navbar/NavBar'
  export default {
    components: {
      NavBar
    },
    data () {
      return {
        goodsId: null,
        titles: [
          '商品', '参数', '评论', '推荐'
        ],
        currentIndex: 0
      };
    },
    computed: {

    },
    methods: {
      titleClick(index) {
        this.currentIndex = index;
      },

      backClick() {
        this.$router.back()
      }
    },
  }
</script>

<style  scoped>
  .title {
    display: flex;
  }

  .active {
    color: var(--color-high-text);
  }

  .back img {
    margin-top: 10px;
  }
</style>